package com.open.party.cloud.view.examine.examineForGanbu

import android.os.Bundle
import android.view.View
import cn.android.x.model.data.AppPageData
import cn.android.x.model.data.ResultInfo
import cn.android.x.parent.AppEventBusTitleBaseActivity
import com.open.party.cloud.R
import com.open.party.cloud.model.ArticleEntity
import com.open.party.cloud.viewModel.ArticleViewModel
import com.sinothk.android.utils.XUtils
import kotlinx.android.synthetic.main.examine_gan_bu_for_type_main.*
import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode

class ExamineTypeForGanBuMainActivity : AppEventBusTitleBaseActivity(), View.OnClickListener {
    private var viewModel: ArticleViewModel? = null

    override fun getLayoutResId(): Int = R.layout.examine_gan_bu_for_type_main

    @Subscribe(threadMode = ThreadMode.MAIN)
    public fun receiveStudentEventBus(result: ResultInfo<AppPageData<ArticleEntity>>) {
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setViewTitle("干部考试")
        viewModel = ArticleViewModel()

        type01Item.setOnClickListener(this)
        type02Item.setOnClickListener(this)
    }

    override fun onClick(v: View?) {
        when (v) {
            type01Item -> {
                XUtils.intent().openActivity(this@ExamineTypeForGanBuMainActivity, ExamineForGanBuMoNiMainActivity::class.java)
                    .start()
            }
            type02Item -> {
                XUtils.intent().openActivity(this@ExamineTypeForGanBuMainActivity, ExamineForGanBuZhengShiMainActivity::class.java)
                    .start()
            }
        }
    }
}